from app.controllers.base_controller import BaseController
from app.crud.api_crud import ApiCRUD
from app.models import Api
from app.schemas.api_schema import ApiUpdate, ApiCreate
from app.schemas.result_schema import ResultFormat, ResultModel


class ApiController(BaseController[ApiCRUD,Api,ApiCreate,ApiUpdate]):
    async def sync(self) -> ResultModel[bool]:
        result = await self.crud.sync()
        return ResultFormat.result_bool(data=result, model_name="同步Api接口")

